package tech.aistar.day02;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 本类功能:
 *
 * @author cxylk
 * @date 2020/9/16 18:04
 */
@WebServlet(urlPatterns = "/day02/hello")
public class HelloAction extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getRequestDispatcher("/WEB-INF/hello.jsp").forward(req,resp);

        //重定向会报错
//        resp.sendRedirect("/WEB-INF/hello.jsp");
    }
}
